package yxy.game.pm2.bean.pubsub;

import yxy.apple.util.PubSub.ISubscription;
import yxy.apple.util.PubSub.Publisher;

// 修炼塔发布者
public class TowerPublisher extends Publisher {

	static private TowerPublisher instance;

	public static TowerPublisher getInstance() {
		if (instance == null) {
			instance = new TowerPublisher();
		}
		return instance;
	}

	private TowerPublisher() {

	}

	public void publish(String playerCode, int floor) {
		this.publish(new TowerSubscription(playerCode, floor));
	}

	public static class TowerSubscription implements ISubscription {
		private String playerCode;
		private int floor;

		public TowerSubscription(String playerCode, int floor) {
			this.playerCode = playerCode;
			this.floor = floor;
		}

		public String getPlayerCode() {
			return playerCode;
		}

		public int getFloor() {
			return floor;
		}

	}

}
